package com.edais.persistence.gift;

import com.edais.domain.gift.GiftPackageOrder;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

/**
 * 礼包订单Mapper
 * Created by haoyx on 2016/11/14.
 */
public interface GiftPackageOrderMapper {

    int deleteByPrimaryKey(Long id);

    int insert(GiftPackageOrder order);

    GiftPackageOrder selectByPrimaryKey(Long id);

    int updateOrderStatus(GiftPackageOrder order);

    GiftPackageOrder selectGiftPackageOrder(Map<String,Object> params);

    List<GiftPackageOrder> selectGiftPackageOrders(Map<String,Object> params);

    int countGiftPackageOrders(Map<String,Object> params);

    BigDecimal sumGiftPackageOrders(Map<String,Object> params);

    /**
     * 
     * 根据cardNo查询订单信息
     * @param cardNo
     * @return
     */
    GiftPackageOrder queryGiftPackageOrderByCardNo(@Param("cardNo")String cardNo);
    
    /**
     * 获取礼包订单数量根据userId phone status 
     * @param params
     * @return
     */
    int getGiftPackageOrderByMap(Map<String,Object> params);
    /**
     * 解冻或者冻结
     * @param params
     * @return
     */
    int  updateOrderStatusByMap(Map<String,Object> params);
    /**
     * 根据cardNo查询K码赠送理财表中该cardNo的数量
     * @param cardNo
     * @return
     */
    int queryCountKcodeLicai(@Param("cardNo")String cardNo);
}
